package com.tplan.tplanrabbitmqserver.controllor;

import com.tplan.domain.Email;
import com.tplan.tplanrabbitmqserver.sender.EmailMqSender;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("email")
public class EmailSendControllor {
    @Autowired
    EmailMqSender emailMqSender;

    @PostMapping("/test")
    public void test(@RequestBody Email email) {
        emailMqSender.sendEmail(email);
        System.out.println("email===" + email.getContent());
        ;
    }


}
